<!doctype html>
<html lang="zh-CN">

<head>
  {include file="home_template/mz_static" title="$title" keywords="$site_info.site_seo_keywords"
  description="$site_info.site_seo_description" /}
</head>

<body class="user-select single" style="overflow:hidden;">

  {include file="mz_blog/header" /}

  <section class="container">
    <div class="content-wrap">
      <div class="content">



        {//*******************文章标题*******************}
        <header class="article-header">
          <h1 class="article-title"><a>{$cms.name}</a></h1>
          <div class="article-meta">
            <span class="item article-meta-source" data-toggle="tooltip" data-placement="bottom"
              title="版主：{$cms['uid']}">
              <i class="glyphicon glyphicon-user"></i> {$cms['uid']}
            </span>
            <span class="item article-meta-views" data-toggle="tooltip" data-placement="bottom"
              title="查看：{$cms.browse|floor}">
              <i class="glyphicon glyphicon-eye-open"></i> 共{$cms.browse|floor}人围观
            </span>
            <span class="item article-meta-comment" data-toggle="tooltip" data-placement="bottom"
              title="评论：{$cms.comment|floor}">
              <i class="glyphicon glyphicon-comment"></i> {$cms.comment|floor}个不明物体
            </span>
          </div>
        </header>
        {//*******************文章标题*******************}

        {//******************文章主内容******************}
        {if 1>2}
        <link rel="stylesheet" href="__MAINASSETS__/editormd/css/editormd.css" />
        <article class="markdown-body editormd-html-preview" style="margin-bottom:30px;"></article>
        {/if}
        {//******************文章主内容******************}



        {include file="mz_blog/component_comment" /}




      </div>
    </div>
    <aside class="sidebar">
      <div class="fixed">
        {//******************公告四栏目******************}
        <div class="widget widget-tabs">
          <ul class="nav nav-tabs" role="tablist">
            <li role="presentation" class="active"><a href="#notice" aria-controls="notice" role="tab"
                data-toggle="tab">网站公告</a></li>
            <li role="presentation"><a href="#centre" aria-controls="centre" role="tab" data-toggle="tab">会员中心</a></li>
            <li role="presentation"><a href="#contact" aria-controls="contact" role="tab" data-toggle="tab">联系站长</a>
            </li>
            <li role="presentation"><a href="#tongji" aria-controls="tongji" role="tab" data-toggle="tab">统计信息</a></li>
          </ul>
          <div class="tab-content">
            <div role="tabpanel" class="tab-pane notice active" id="notice">
              <ul>
                <li>
                  <time datetime="2020-03-16">03-16</time>
                  <a href="#">欢迎访问梦幻空间站博客</a>
                </li>
                <li>
                  <time datetime="2020-01-06">01-06</time>
                  <a href="#">在这里可以看到前端技术，后端程序，网站内容管理系统等文章，还有我的程序人生！</a>
                </li>
              </ul>
            </div>
            <div role="tabpanel" class="tab-pane centre" id="centre">
              {empty name="$user"}
              <h4>需要登录才能进入会员中心</h4>
              <p><a href="/login/login" class="btn btn-primary">立即登录</a> <a href="/login/register"
                  class="btn btn-default">现在注册</a></p>
              {else /}
              {$user.nick}<br />
              {$user.autograph}
              {/empty}
            </div>
            <div role="tabpanel" class="tab-pane contact" id="contact">
              <h2>Email : <a href="mailto:choasmida@foxmail.com" data-toggle="tooltip" data-placement="bottom"
                  title="choasmida@foxmail.com">choasmida@foxmail.com</a></h2>
            </div>
            <div role="tabpanel" class="tab-pane contact" id="tongji">
              {if 1>2}
              <h2>日志总数:888篇</h2>
              <h2>网站运行:<span id="sitetime">88天 </span></h2>
              {/if}
            </div>
          </div>
        </div>
        {//******************公告四栏目******************}
        <div class="widget widget_search">
          <form class="navbar-form" action="/Search" method="post">
            <div class="input-group">
              <input type="text" name="keyword" class="form-control" size="35" placeholder="请输入关键字" maxlength="15"
                autocomplete="off">
              <span class="input-group-btn">
                <button class="btn btn-default btn-search" name="search" type="submit">搜索</button>
              </span> </div>
          </form>
        </div>
      </div>
      {//***************每日一句***************}
      <div class="widget widget_sentence">
        <h3>每日一句</h3>
        <div class="widget-sentence-content" style="min-height:100px;">
          <h4>{$erysts.dt}</h4>
          <p>{$erysts.co|raw}</p>
        </div>
      </div>
      {//***************热门文章***************}
      <div class="widget widget_hot">
        <h3>热门文章</h3>
        <ul>
          {foreach name="hotacl" item="vol" key="k" }
          <li>
            <a href="/{$vol.aid}" target="_blank">
              <span class="thumbnail"><img class="thumb"
                  data-original="{$vol.cover_img1|default='__MZBLOG__/images/excerpt.jpg'}"
                  src="{$vol.cover_img1|default='__MZBLOG__/images/excerpt.jpg'}" alt="{$vol.title}"></span>
              <span class="text">{$vol.title}</span>
              <span class="muted"><i class="glyphicon glyphicon-time"></i> {$vol.update_time|date='Y-m-d'}</span>
              <span class="muted"><i class="glyphicon glyphicon-eye-open"></i> {$vol.browse|floor}</span>
            </a>
          </li>
          {/foreach}
        </ul>
      </div>
    </aside>
  </section>

  {include file="home_template/mz_footer" /}


  {//回复按钮点击与添加评论框}
  <div id="respond" name="reply_model" style="display:none;">
    <div class="comment">
      <div class="comment-title">
        {empty name="user.hport"}
        <img class="avatar" src="/static/main/noavatar_small.gif" />
        {else /}
        <img class="avatar" src="{$user.hport}" />
        {/empty}
      </div>
      <div>
        <input class="comment_input comment_name" placeholder="姓名或昵称 (必填)" id="comment_name" name="nick" maxlength="15"
          tabIndex="1" value="{$user.nick}" />
        <input class="comment_input comment_email" placeholder="邮箱(必填,将保密)以便回复您" id="comment_email" name="email"
          maxlength="50" tabIndex="2" value="{$user.email}" />
        <input class="comment_input comment_url" placeholder="网站或博客 http://xxxx" id="comment_url" name="website"
          maxlength="50" tabIndex="3" value="{$user.website}" />
      </div>
      <div class="comment-box">
        <textarea placeholder="您的评论可以一针见血" name="comment-textarea" id="comment-textarea" class="comment-textarea"
          cols="100%" rows="3" tabIndex="4"></textarea>
        <div class="comment-ctrl">
          <span class="emotion"><img src="https://www.liangjucai.com/Index/images/face/5.png" width="20"
              height="20" />表情</span>
          <div class="comment-prompt"><i class="fa fa-spin fa-circle-o-notch"></i><span
              class="comment-prompt-text">评论正在提交中...请稍后</span></div>
          <div class="comment-success" id="comok"><i class="fa fa-check"></i><span
              class="comment-prompt-text">评论提交成功...</span></div>
          <div class="comment-success" id="cinfo"><i class="fa fa-close"></i><span class="comment-prompt-text"></span>
          </div>
          <button type="button" id="comment-submit" class="comment-submit">评论</button>
        </div>
      </div>
    </div>
  </div>
  {//qqFace表情包}
  <script src="https://www.liangjucai.com/Index/js/jquery.qqFace.js"></script>
  <script>
    $(document).ready(function (e) {
      $('.emotion').qqFace({
        id: 'facebox',
        assign: 'comment-textarea',
        path: '__MZBLOG__/images/arclist/'  //表情存放的路径
      });
    });
  </script>
  {//qqFace表情包}
  <script>
    //点击回复按钮
    function reply($id, that, $st) {
      $("div[name='reply_model_this']").remove();
      $("#comment-submit").attr('onclick', 'comment(' + $id + ',this)');
      $html = '<div id="respond" name="reply_model_this">' + $("div[name='reply_model']").html() + '</div>';
      if ($st == 1) {
        $(that).parent().parent().parent().after($html);
      } else {
        $(that).parent().parent().parent().append($html);
      }
    }
  </script>
  {//回复按钮点击与添加评论框}
  <script>
    //提交留言
    function comment($id, that) {
      $(that).parent().children(".comment-prompt").show();
      $(that).parent().children(".comment-success").hide();
      $.post("{:url('index/submit_comments')}",
        {
          nick: $(that).parent().parent().parent().children("div").children("input[name='nick']").val(),
          email: $(that).parent().parent().parent().children("div").children("input[name='email']").val(),
          website: $(that).parent().parent().parent().children("div").children("input[name='website']").val(),
          comment: $(that).parent().parent().children("textarea[name='comment-textarea']").val(),
          aid: "{$cms.cid}",
          reply: $id,
        },
        function (data, status) {
          $(that).parent().children(".comment-prompt").hide();
          if (data.state == 'success') {
            $(that).parent().children("#comok").show();
            if ($id == '0') { //主評論模板
              $html = '<ol class="commentlist" id="coml_' + data.id + '"><li class="comment-content"><div class="comment-hf"><div><span class="comment-f">&nbsp;&nbsp;&nbsp;&nbsp;</span></div><div><a class="comm_hf_btn text-danger" data-id="' + data.id + '" onclick="recall(' + data.id + ',this)">撤回</a></div></div><div class="comment-avatar"><span class="avatar">' + data.nick.substring(0, 1) + '</span></div><div class="comment-main"><p><a href="#" target="_blank">' + data.nick + '</a><span class="time">(' + data.time + ')</span><br /><span class="useressay">' + data.essay + '</span></p></div></li></ol>';
              $("#postcomments").prepend($html);
              $(that).parent().parent().children("textarea[name='comment-textarea']").val('');
              $(that).parent().children(".comment-success").hide();
            } else {        //副評論模板
              $html = '<li class="comment-content comm_list w-94" id="coml_' + data.id + '"><div class="comment-hf"><div><span class="comment-f">&nbsp;&nbsp;&nbsp;&nbsp;</span></div><div><a class="comm_hf_btn text-danger" data-id="' + data.id + '" onclick="recall(' + data.id + ',this)">撤回</a></div></div><div class="comment-avatar"><span class="avatar">' + data.nick.substring(0, 1) + '</div><div class="comment-main"><p><a href="#" target="_blank">' + data.nick + '</a><span class="f-m-l">回复</span><a class="f-m-l" href="#" target="_blank">@ ' + data.retnick + '</a><span class="time">(' + data.time + ')</span><br /><span class="useressay">' + data.essay + '</span></p></div></li>';
              $("#colm_" + $id).parent().append($html);
              $(that).parent().parent().children("textarea[name='comment-textarea']").val('');
              $(that).parent().children(".comment-success").hide();
              $("div[name='reply_model_this']").remove();
            }
            replace_em(); //替换评论中的表情
          } else {
            $(that).parent().children("#cinfo").children("span").text(data.info);
            $(that).parent().children("#cinfo").show();
          }
        });
    }
    //撤回留言
    function recall($id, that) {
      if (confirm('确认撤回此条信息吗？两分钟之内可撤回') === true) {
        $.post("/index/json_comment_recall",
          {
            id: $id,
          },
          function (data, status) {
            if (data.state == 'success') {
              message.add(data.info, 'success');
              $("#coml_" + $id).remove();
            } else {
              message.add(data.info, 'error');
            }
          }).fail(function () {
            message.add('error响应，没有进入success', 'error');
          });
      } else {
        return 0;
      }
    }
  </script>
  {if isset($user['limit']) && in_array('Q64', explode(',',$user['limit']))}
  <script>
    // 修改留言
    function json_comment_update() {

    }
    // 删除留言
    function json_comment_delete($id, that) {
      if (confirm('确认删除此留言吗？') === true) {
        $.post("/index/json_comment_delete",
          {
            id: $id,
          },
          function (data, status) {
            if (data.state == 'success') {
              message.add(data.info, 'success');
              $("#colm_" + $id).remove();
            } else {
              message.add(data.info, 'error');
            }
          }).fail(function () {
            message.add('error响应，没有进入success', 'error');
          });
      } else {
        return 0;
      }
    }
  </script>
  {/if}
  <script>
    // 替换评论中的表情
    function replace_em() {
      $(".useressay").each(function (index, el) {
        $comment = $(this).html();
        $comment = $comment.replace(/\[em_([0-9]*)\]/g, '<img src="__MZBLOG__/images/arclist/$1.gif" border="0" />');
        $(this).html($comment);
      });
    }
    replace_em();
  </script>
</body>

</html>